package cn.gok.hotelback.controller;

import cn.gok.hotelback.entity.RoomType;
import cn.gok.hotelback.service.RoomTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/roomtype")
public class RoomTypeController {
    @Autowired
    private RoomTypeService roomTypeService;

    @GetMapping("/list")
    public List<RoomType> getAllRoomTypes() {
        return roomTypeService.getAllRoomTypes();
    }

    @GetMapping("/detail")
    public RoomType getRoomTypeDetail(@RequestParam Integer typeId) {
        return roomTypeService.getRoomTypeById(typeId);
    }
} 
